package com.turato.responsibility;

/**
 * @author tuhao
 * @date 2021/1/24 4:56 下午
 * @desc 测试cook
 */
public class App {
    public static void main(String[] args) {
        /** 下面 **/
        CookHandlerRequest request = new CookHandlerRequest("煮");
        BoilCookHandler boilNoodleCookHandler = new BoilCookHandler("煮");
        NoodleCookHandler noodleCookHandler = new NoodleCookHandler("下面");
        // 组合流程
        boilNoodleCookHandler.setNext(noodleCookHandler);
        boilNoodleCookHandler.handleRequest(request);

        System.out.println("--------------------------------------------------------");

        /** 番茄鸡蛋汤 **/
        EggCookHandler eggCookHandler = new EggCookHandler("处理鸡蛋");
        TomatoCookHandler tomatoCookHandler = new TomatoCookHandler("处理番茄");
        BoilCookHandler boilSoupCookHandler = new BoilCookHandler("煮");
        // 组合流程
        boilSoupCookHandler.setNext(eggCookHandler);
        eggCookHandler.setNext(tomatoCookHandler);
        boilSoupCookHandler.handleRequest(request);

//        =======BoilCookHandler:煮=======
//        =======NoodleCookHandler:下面=======
//        =======NoodleCookHandler:烹饪结束=======
//        --------------------------------------------------------
//        =======BoilCookHandler:煮=======
//        =======PotatoCookHandler:处理鸡蛋=======
//        =======TomatoCookHandler:处理番茄=======
//        =======TomatoCookHandler:烹饪结束=======
    }
}
